<html>
<head><meta charset="utf-8"><title>std::env locking · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/std.3A.3Aenv.20locking.html">std::env locking</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225427379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/std%3A%3Aenv%20locking/near/225427379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/std.3A.3Aenv.20locking.html#225427379">(Feb 06 2021 at 19:51)</a>:</h4>
<p>Is there any reason why <code>std::env::var_os</code> and similar use a Mutex instead of a RWLock? Reading seems way more frequent than writing after all.</p>



<a name="225437740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/std%3A%3Aenv%20locking/near/225437740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/std.3A.3Aenv.20locking.html#225437740">(Feb 07 2021 at 00:44)</a>:</h4>
<p><span class="user-mention" data-user-id="330154">@The 8472</span> I don't think there's a specific reason for that. RWLock is just often forgotten about ^^'</p>



<a name="225437742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/std%3A%3Aenv%20locking/near/225437742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/std.3A.3Aenv.20locking.html#225437742">(Feb 07 2021 at 00:44)</a>:</h4>
<p>Feel free to <code>r?</code> me on a PR, if you want to change it.</p>



<a name="225437753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/std%3A%3Aenv%20locking/near/225437753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/std.3A.3Aenv.20locking.html#225437753">(Feb 07 2021 at 00:45)</a>:</h4>
<p>it might not be a trivial change though, because there's no StaticRWLock yet, and we create a <code>&amp;mut</code> to <code>environ</code> right now.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>